prime number program in python using function